<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>cart</title>

    <!--获取屏幕宽度，根据屏幕宽度进行自适应-->
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!--引入bootStrap-->
    <link rel="stylesheet" href="bootstrap-3.3.7-dist/css/bootstrap.min.css"/>

    <!--bootstrap 依赖jQuery-->
    <script src="js/jquery-3.5.0.min.js"></script>
    <script src="bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="css/header.css" type="text/css"/>
</head>
<body>
<script src="js/header.js">
</script>
<div class="container">
    <div class="row">
        <div class="panel panel-default">
            <div class="panel-heading"><h3 class="panel-title">购物车</h3></div>
            <div class="panel-body">
                <table class="table table-bordered table-hover">
                    <thead>
                    <tr>

                        <th><input type="checkbox" style="margin: 0 0 0 0"> 全选</th>
                        <th>商品</th>
                        <th>描述</th>
                        <th>单价</th>
                        <th>数量</th>
                        <th>总价</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody id="table_goods">

                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>


<template id="template_goods">
    <tr>
        <td>
            <input onchange="cancelCheckAll(this)" type="checkbox" value="{{id}}" style="vertical-align:middle;">
        </td>
        <td>
            <img src="{{goodsUrl}}" class="img-thumbnail img-goods">
        </td>
        <td width="50%" class="good_remark">
            {{goodsName}}
        </td>
        <td>
            ￥{{goodsPrice}}
        </td>
        <td>
            <div class="row">
                <div class="col-lg-6">
                    <div class="input-group">
     <span class="input-group-btn">
       <button class="btn btn-default" type="button" onclick="reduceNumber({{number}},{{id}})">-</button>
     </span>

                        <input type="text" class="form-control" placeholder="2" value="{{number}}" style="width: 50px;">


     <span class="input-group-btn">
       <button class="btn btn-default" type="button" onclick="increaseNumber({{number}},{{id}})">+</button>
     </span>
                    </div>
                </div>
            </div>
        </td>
        <td>
            ￥{{subtotal}}
        </td>
        <td>
            <a href="javascript:delGoods({{id}})">删除</a>
        </td>
    </tr>
</template>

<nav class="navbar navbar-default navbar-fixed-bottom">
    <div class="container">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <a class="navbar-brand" href="#">全选
                <input type="checkbox" onchange="checkboxAll(this)" class="checkbox-all">
            </a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <li>
                    <a href="javascript:delGoodsList()">删除</a>
                </li>
                <li>
                    <a href="javascript:delAll()" >清空购物车</a>
                </li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                <li>
                    <a href="#">共计选择
                        <small>1</small>
                        件商品</a>
                </li>
                <li><a href="#">总价：￥<big id="big_sum_amount"></big></a></li>
                <li><a href="#" class="btn btn-default navbar-btn">结算</a></li>
            </ul>
        </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
</nav>

</body>
</html>

<script src="js/cartList.js"></script>